from django.conf.urls import url
from rest_framework.routers import DefaultRouter
from rest_framework_jwt.views import obtain_jwt_token
# 'JWT_PAYLOAD_HANDLER':
# from rest_framework_jwt.utils import jwt_payload_handler
from apps.django_admin.views.UserTotalCount import SPUSimpleView, Specs
from .views import UserTotalCount,sku
urlpatterns =[url(r'authorizations/$', obtain_jwt_token),
              url(r'statistical/total_count/$', UserTotalCount.UserTotalCountView.as_view()),
              url(r'statistical/day_active/$', UserTotalCount.day_active.as_view()),
              url(r'statistical/day_increment/$', UserTotalCount.day_increment.as_view()),
              url(r'statistical/day_orders/$', UserTotalCount.day_orders.as_view()),
              url(r'statistical/month_increment/$', UserTotalCount.month_increment.as_view()),
              url(r'statistical/goods_day_views/$', UserTotalCount.goods_day_views.as_view()),
              url(r'users/$', UserTotalCount.users.as_view()),
              url(r'^goods/simple/$', SPUSimpleView.as_view({'get':'list'})),
              url(r'skus/categories/$', sku.Categories.as_view()),
              url(r'goods/(?P<pk>\d+)/specs/$', sku.goods_specs.as_view()),

              ]
router = DefaultRouter()
router.register(r'goods/specs',Specs,base_name='specs')
router.register(r'skus',sku.SKUGoodsView, base_name='skus')

# router.register('goods/specs(?P<pk>\d+)/',UserTotalCount.Specs,base_name='specs')
urlpatterns+=router.urls
